package com.google.denta.dao.ibatis;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.google.denta.dao.RoleDao;
import com.google.denta.entity.Role;
import com.google.denta.exception.MethodUnsupportedException;

/**
 * @author Siarhei_Sabetski
 */
public final class RoleSqlMapDao extends SqlMapClientDaoSupport
                    implements RoleDao {

    /** {@inheritDoc} */
    public Long create(final Role newInstance) {
        throw new MethodUnsupportedException();
    }

    /** {@inheritDoc} */
    public Role read(final Long id) {
        return (Role) getSqlMapClientTemplate().queryForObject("Role.read", id);
    }

    /** {@inheritDoc} */
    public void update(final Role transientObject) {
        throw new MethodUnsupportedException();
    }

    /** {@inheritDoc} */
    public void delete(final Long id) {
        throw new MethodUnsupportedException();
    }

    /** {@inheritDoc} */
    @SuppressWarnings("unchecked")
    public List<Role> findAll() {
        return getSqlMapClientTemplate().queryForList("Role.findAll");
    }

}
